<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let lastTime = performance.now();

        const checkPerformance = () => {
            const currentTime = performance.now();
            if (currentTime - lastTime > 100) { // 阈值可以根据实际情况调整
                console.log('控制台打开');
            }
            lastTime = currentTime;
        };

        setInterval(checkPerformance, 1000); // 每秒检查一次
    </script>
</body>

</html>